<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<link href="style/css/manual-zip.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
<link href="style/css/manual-zip-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
<link href="style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
<title>服务器全局配置 － Apache 2.2 中文手册 [金步国]</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head>
<body id="manual-page">
<div id="page-header"><p class="menu"><a href="mod/index.html">模块索引</a> | <a href="mod/directives.html">指令索引</a> | <a href="faq/index.html">常见问题</a> | <a href="glossary.html">词汇表</a> | <a href="sitemap.html">站点导航</a></p><p class="apache">Apache HTTP Server 版本2.2</p><img alt="" src="images/feather.gif" /></div>
<div class="up"><a href="index.html"><img title="&lt;-" alt="&lt;-" src="images/left.gif" /></a></div>
<div id="path"><a href="https://www.apache.org/">Apache</a> &gt; <a href="https://httpd.apache.org/">HTTP Server</a> &gt; <a href="https://httpd.apache.org/docs/">文档</a> &gt; <a href="index.html">版本2.2</a></div>

<div id="translation-info">　　 <a href="translator_announcement.html#thanks">致谢</a> | 本篇译者：<a href="../../index.html">金步国</a>(<a href="../../index.html">作品集</a>) | 本页最后更新：2006年10月20日</div>
<div id="page-content"><div id="preamble"><h1>服务器全局配置</h1>


<p>本文档说明了由服务器核心(<code class="module"><a href="mod/core.html">core</a></code>)提供的以实现基本服务器运转的一些指令。</p>
</div>
	<div class="top"><a href="server-wide.html#page-header"><img alt="top" src="images/up.gif" /></a></div>
<div class="section">
<h2><a name="identification" id="identification">服务器标识</a></h2>


    <table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="related">
<tr><th>相关模块</th><th>相关指令</th></tr>
<tr><td /><td><ul><li><code class="directive"><a href="mod/core.html#servername">ServerName</a></code></li><li><code class="directive"><a href="mod/core.html#serveradmin">ServerAdmin</a></code></li><li><code class="directive"><a href="mod/core.html#serversignature">ServerSignature</a></code></li><li><code class="directive"><a href="mod/core.html#servertokens">ServerTokens</a></code></li><li><code class="directive"><a href="mod/core.html#usecanonicalname">UseCanonicalName</a></code></li><li><code class="directive"><a href="mod/core.html#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li></ul></td></tr>
</table>

    <p><code class="directive"><a href="mod/core.html#serveradmin">ServerAdmin</a></code>和<code class="directive"><a href="mod/core.html#servertokens">ServerTokens</a></code>指令控制有关服务器的哪些信息将出现在服务器生成的文档中(如错误消息)。<code class="directive"><a href="mod/core.html#servertokens">ServerTokens</a></code>指令设置服务器HTTP响应头字段的值。</p>

    <p><code class="directive"><a href="mod/core.html#servername">ServerName</a></code>、<code class="directive"><a href="mod/core.html#usecanonicalname">UseCanonicalName</a></code>、<code class="directive"><a href="mod/core.html#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code>指令用来决定怎样构建自引用URL，譬如，某客户端对一个目录发出请求，但没有包含目录名最后的斜线"/"，Apache将重定向客户端到包含"/"的全名，以使得客户端可以正确解析文档中的相对引用。</p>
  </div><div class="top"><a href="server-wide.html#page-header"><img alt="top" src="images/up.gif" /></a></div>
<div class="section">
<h2><a name="locations" id="locations">文件定位</a></h2>


    <table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="related">
<tr><th>相关模块</th><th>相关指令</th></tr>
<tr><td /><td><ul><li><code class="directive"><a href="mod/mpm_common.html#coredumpdirectory">CoreDumpDirectory</a></code></li><li><code class="directive"><a href="mod/core.html#documentroot">DocumentRoot</a></code></li><li><code class="directive"><a href="mod/core.html#errorlog">ErrorLog</a></code></li><li><code class="directive"><a href="mod/mpm_common.html#lockfile">LockFile</a></code></li><li><code class="directive"><a href="mod/mpm_common.html#pidfile">PidFile</a></code></li><li><code class="directive"><a href="mod/mpm_common.html#scoreboardfile">ScoreBoardFile</a></code></li><li><code class="directive"><a href="mod/core.html#serverroot">ServerRoot</a></code></li></ul></td></tr>
</table>

    <p>这些指令控制Apache正常工作所需的各种文件的定位。如果路径名不以斜线(/)开头，那么就认为该文件是相对于<code class="directive"><a href="mod/core.html#serverroot">ServerRoot</a></code>的相对路径，需要注意路径中的文件哪些对非root用户来说是可写的，参见<a href="misc/security_tips.html#serverroot">安全提示</a>以获得更多细节。</p>
  </div><div class="top"><a href="server-wide.html#page-header"><img alt="top" src="images/up.gif" /></a></div>
<div class="section">
<h2><a name="resource" id="resource">限制资源的使用</a></h2>


    <table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="related">
<tr><th>相关模块</th><th>相关指令</th></tr>
<tr><td /><td><ul><li><code class="directive"><a href="mod/core.html#limitrequestbody">LimitRequestBody</a></code></li><li><code class="directive"><a href="mod/core.html#limitrequestfields">LimitRequestFields</a></code></li><li><code class="directive"><a href="mod/core.html#limitrequestfieldsize">LimitRequestFieldsize</a></code></li><li><code class="directive"><a href="mod/core.html#limitrequestline">LimitRequestLine</a></code></li><li><code class="directive"><a href="mod/core.html#rlimitcpu">RLimitCPU</a></code></li><li><code class="directive"><a href="mod/core.html#rlimitmem">RLimitMEM</a></code></li><li><code class="directive"><a href="mod/core.html#rlimitnproc">RLimitNPROC</a></code></li><li><code class="directive"><a href="mod/mpm_common.html#threadstacksize">ThreadStackSize</a></code></li></ul></td></tr>
</table>

    <p><code class="directive">LimitRequest*</code> 系列指令用来限制Apache在读取客户端请求的过程中使用的资源数量。通过限制这些值，可以减轻某些拒绝服务(DOS)攻击。</p>

    <p><code class="directive">RLimit*</code> 系列指令限制被Apache子进程所派生的进程使用的资源数量，通常，这些指令用来控制CGI脚本和SSI exec命令所使用的资源。</p>

    <p><code class="directive"><a href="mod/mpm_common.html#threadstacksize">ThreadStackSize</a></code>指令在某些平台上用来控制堆栈大小。</p>
  </div></div>
<div id="footer">
<p class="apache">本文允许自由的转载、引用、再分发，但必须保留译者署名并注明出处；详见：<a href="translator_announcement.html#announcement">版权声明</a>。</p>
<p class="menu"><a href="mod/index.html">模块索引</a> | <a href="mod/directives.html">指令索引</a> | <a href="faq/index.html">常见问题</a> | <a href="glossary.html">词汇表</a> | <a href="sitemap.html">站点导航</a></p></div>
</body></html>
